<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例3</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .content {
            width: 400px;
            margin: 50px auto;
            border: 1px orangered solid;
        }
        
        .header {
            color: orange;
            padding: 3px 20px;
            font-size: 22px;
            border: 1px solid orange;
            background-color: rgb(255, 235, 215);
        }
        
        .body {
            border: 1px solid orange;
            padding: 20px;
        }
        
        button {
            border: 0;
            padding: 5px 22px;
            color: #eee;
            background: orange;
            margin-top: 10px;
            margin-left: 60px;
        }
    </style>
</head>

<body>
    <div class="content">
        <div class="header">
            用户登录
        </div>
        <div class="body">
            <p>用户名：<input type="text" onfocus="d1(this)" onblur="this.style.background=''"></p>
            <p>密　码：<input type="text" onfocus="d1(this)" onblur="this.style.background=''"></p>
            <p><button>登录</button></p>
        </div>
    </div>

    <script>
        function d1(e) {
            e.style.background = 'url(./img/input.png) 0 -31px'
        }
    </script>
</body>

</html>